import fetch from '@/api'

// 机械监控,数据获取
export function getMechanicsWatch(params){
    return fetch({
        method:'get',
        url:`/mechanicsWatch`,
        params
    })
}

// 机械监控-状态切换-启用
export function mechanicsWatchEnable(id){
    return fetch({
        method:'get',
        url:`/mechanicsWatch/${id}/enable`,
    })
}

// 机械监控-状态切换-启用
export function mechanicsWatchDisable(id){
    return fetch({
        method:'get',
        url:`/mechanicsWatch/${id}/disable`,
    })
}

// 机械监控-登录
export function mechanicsWatchLogin(id,data){
    return fetch({
        method:'post',
        url:`/mechanicsWatch/${id}/login`,
        data
    })
}

// 机械监控-注销
export function mechanicsWatchLogout(id,data){
    return fetch({
        method:'post',
        url:`/mechanicsWatch/${id}/logout`,
        data
    })
}

// 获取预警信息
export function getWarnInfo(params){
    return fetch({
        method:'get',
        url:`/warnMsg`,
        params,
    })
}

// 堆场监控-统计
export function getYardCount(params){
    return fetch({
        method:'get',
        url:`/containerYardField/yardWatch`,
        params
    })
}

// 未完结指令-分页
export function getUnfinishedCommand(params){
    return fetch({
        method:'get',
        url:`/command/unfinished`,
        params
    })
}

// 作废记录-分页
export function getObsoleteRecord(params){
    return fetch({
        method:'get',
        url:`/command/obsoleteRecord`,
        params
    })
}

// 已完成指令-分页
export function getFinishedCommand(params){
    return fetch({
        method:'get',
        url:`/command/finished`,
        params
    })
}

// 子指令-分页
export function getCommad(id){
    return fetch({
        method:'get',
        url:`/command/${id}`
    })
}

export function editCommad(id,data){
    return fetch({
        method:'post',
        url:`/command/${id}/modify`,
        data
    })
}

// 坏箱-分页
export function getBadBox(params){
    return fetch({
        method:'get',
        url:`/badBox`,
        params,
    })
}

// 坏箱-统计
export function getBadBoxCount(params){
    return fetch({
        method:'get',
        url:`/badBox/count`,
        params
    })
}

// 坏箱-新增
export function addBadBox(data){
    return fetch({
        method:'post',
        url:`/badBox`,
        data
    })
}
// 坏箱-编辑
export function updateBadBox(id,data){
    return fetch({
        method:'put',
        url:`/badBox/${id}`,
        data
    })
}
// 坏箱-删除
export function delBadBox(id){
    return fetch({
        method:'delete',
        url:`/badBox/${id}`
    })
}

// 坏箱-标记正常
export function toNormal(data){
    return fetch({
        method:'post',
        url:`/badBox/normal`,
        data
    })
}

// 坏箱-批量导入
export function importBadBox(data){
    return fetch({
        method:'post',
        url:`/badBox/import`,
        data
    })
}

// 作业监控-统计
export function getJobWatch(params){
    return fetch({
        method:'get',
        url:`/jobWatch/count`,
        params,
    })
}

// 作业监控-未补录车皮
export function getJobNoWagonNo(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/zc/wagonNo`,
        params
    })
}
// 作业监控-未补录车皮统计
export function getWagonNoCount(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/wagonNo/endStation`,
        params
    })
}

// 闸口-进场箱号查询
export function getGateContainerIn(params){
    return fetch({
        method:'get',
        url:`/gate/in/entrust`,
        params
    })
}
// 闸口-出库箱号查询
export function getGateContainerOut(params){
    return fetch({
        method:'get',
        url:`/gate/out/entrust`,
        params
    })
}

// 闸口-委托号查询
export function getEntrustNo(params){
    return fetch({
        method:'get',
        url:`/gate/heap/entrust`,
        params
    })
}

// 闸口-进场入库
export function gateContainerIn(data){
    return fetch({
        method:'post',
        url:`/gate/in`,
        data
    })
}

// 闸口-提货出库
export function gateContainerOut(data){
    return fetch({
        method:'post',
        url:`/gate/out`,
        data
    })
}
// 闸口-大堆箱提货出库
export function gateContainerOutHeap(data){
    return fetch({
        method:'post',
        url:`/gate/out/heap`,
        data
    })
}

// 闸口-在港车记录
export function getOnPortCar(params){
    return fetch({
        method:'get',
        url:`/gate/onPortCar`,
        params,
    })
}
// 闸口-在港车历史记录
export function getOnPortCarHistory(params){
    return fetch({
        method:'get',
        url:`/gate/onPortCar/history`,
        params,
    })
}

// 闸口-统计
export function getOnPortCount(params){
    return fetch({
        method:'get',
        url:`/gate/onPortCar/statistics`,
        params
    })
}

// 闸口-在港车-取消登记
export function cancelRegister(id){
    return fetch({
        method:'get',
        url:`/gate/cancelRegister/${id}`,
    })
}

// 闸口-在港汽车记录详情->打印小票
export function printTicket(id){
    return fetch({
        method:'get',
        url:`/gate/gateTicket/${id}`
    })
}

// 闸口-小票打印记录
export function getTicket(params){
    return fetch({
        method:'get',
        url:`/gate/ticket`,
        params
    })
}

// 装车-提箱计划池
export function getPlanTable(params){
    return fetch({
        method:'get',
        url:`/jobWatch/suitcase`,
        params
    })
}
// 装车-系统推荐
export function getRecommend(data){
    return fetch({
        method:'post',
        url:`/jobWatch/recommend`,
        data
    })
}

// 装车-修改车皮号
export function editWagonNo(data) {
    return fetch({
        method:'post',
        url:`/jobWatch/up/wagonNo`,
        data
    })
}
// 装车-导入车皮号
export function impWagonNo(data) {
    return fetch({
        method:'post',
        url:`/jobWatch/up/wagonNo/imp`,
        data
    })
}

// 集装箱信息-到站查询
export function getEndInfo(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/statistics/endStation`,
        params,
    })
}

// 集装箱信息-发站查询
export function getStartInfo(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/statistics/startStation`,
        params,
    })
}

// 集装箱信息-货名查询
export function getCargo(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/statistics/cargo`,
        params,
    })
}

// 装车-集装箱信息
export function getZcInfo(params) {
    return fetch({
        method:'get',
        url:`/jobWatch/zc`,
        params
    })
}

// 卸车-集装箱信息
export function getXcInfo(params){
    return fetch({
        method:'get',
        url:`/jobWatch/unload`,
        params
    })
}

// 拆箱-集装箱信息
export function getCxInfo(params){
    return fetch({
        method:'get',
        url:`/jobWatch/unbox`,
        params
    })
}
// 内转出场-集装箱信息
export function getNZCCInfo(params){
    return fetch({
        method:'get',
        url:`/jobWatch/nzcc`,
        params
    })
}
// 内转入场-集装箱信息
export function getNZRCInfo(params){
    return fetch({
        method:'get',
        url:`/jobWatch/nzrc`,
        params
    })
}

// 取消指令
export function cancelCommand(data) {
    return fetch({
        method:'post',
        url:`/jobWatch/cancel`,
        data
    })
}




// 闸口-指令-分页
export function getCommandPage(params){
    return fetch({
        method:'get',
        url:`/gate/command`,
        params,
    })
}

// ---指令---作废
export function commandVoid(data){
    return fetch({
        method:'post',
        url:`/instructions/voids`,
        data
    })
}

// ---指令---激活
export function commandActivate(data){
    return fetch({
        method:'post',
        url:`/instructions/activation`,
        data
    })
}

// ---指令---确认执行
export function commandExecute(data){
    return fetch({
        method:'post',
        url:`/instructions/execute`,
        data
    })
}

// ---指令---撤回
export function commandRevoke(data){
    return fetch({
        method:'post',
        url:`/instructions/revoke`,
        data
    })
}

// ---指令---发布
export function commandRelease(data){
    return fetch({
        method:'post',
        url:`/instructions/release`,
        data
    })
}

// ---指令---推送指令
export function commandPush(){
    return fetch({
        method:'get',
        url:`/instructions`,
    })
}

// ---指令---推送预警信息
export function commandPushMsg(){
    return fetch({
        method:'get',
        url:`/instructions/send`,
    })
}

// 子指令通过机械获取目的场位
export function instructionsPosition(data) {
    return fetch({
        method:'post',
        url:`/instructions/position`,
        data
    })
}


// 通过ID获取车皮顺序
export function jobWatchWagonSortNoId(id) {
    return fetch({
        method:'get',
        url:`/jobWatch/wagonSortNo/${id}`,
    })
}

// 车皮确认排序
export function jobWatchWagonSortNo(data) {
    return fetch({
        method:'post',
        url:`/jobWatch/wagonSortNo`,
        data
    })
}
